﻿using System;
using System.Web;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Runtime.Serialization.Json;
using TwitterWrapper;


namespace TwitterWrapper
{
    public class TwitterDMessage
    {
        private string username = null;
        private string password = null;

        public TwitterDMessage(string name, string pword)
        {
            username = name;
            password = pword;
        }

        public Stream DirectMessages()
        {
            return TwitterCom.HTTPGet(@"http://twitter.com/direct_messages.json", username, password);
        }

        public Stream New(string user, string text)
        {
            return TwitterCom.HTTPGet(@"http://twitter.com/direct_messages/new.json?user="
                +user+"&text="+HttpUtility.UrlEncode(text,Encoding.UTF8), username, password);
        }
    }
}
